<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
 
	<bean id="runMeTask" class="br.com.news.rss.RSSReader" />
	<bean id="runSendEmailAnuncio" class="br.com.news.mail.EmailSenderAnuncio">
		<property name="mailSender" ref="mailSenderAnuncio"></property>
		<property name="velocityEngine" ref="velocityEngine"></property>
	</bean>
	
	<bean id="runSendEmailContato" class="br.com.news.mail.EmailSenderContato">
		<property name="mailSender" ref="mailSenderContato"></property>
		<property name="velocityEngine" ref="velocityEngine"></property>
	</bean>
	
	<bean id="runSendEmailNoticia" class="br.com.news.mail.EmailSenderNoticia">
		<property name="mailSender" ref="mailSenderContato"></property>
		<property name="velocityEngine" ref="velocityEngine"></property>
	</bean>
 
	<!-- Spring Quartz -->
	<bean name="runMeJob" class="org.springframework.scheduling.quartz.JobDetailBean">
		<property name="jobClass" value="com.mkyong.common.RunMeJob" />
		<property name="jobDataAsMap">
		  <map>
			<entry key="rSSReader" value-ref="runMeTask" />
		  </map>
		</property>
	</bean>
	
	<bean name="runJobSendAnuncio" class="org.springframework.scheduling.quartz.JobDetailBean">
		<property name="jobClass" value="br.com.news.mail.JobSendAnuncio" />
		<property name="jobDataAsMap">
		  <map>
			<entry key="emailSender" value-ref="runSendEmailAnuncio" />
		  </map>
		</property>
	</bean>
	
	<bean name="runJobSendNoticia" class="org.springframework.scheduling.quartz.JobDetailBean">
		<property name="jobClass" value="br.com.news.mail.JobSendNoticia" />
		<property name="jobDataAsMap">
		  <map>
			<entry key="emailSender" value-ref="runSendEmailNoticia" />
		  </map>
		</property>
	</bean>
	
	<bean name="runJobSendContato" class="org.springframework.scheduling.quartz.JobDetailBean">
		<property name="jobClass" value="br.com.news.mail.JobSendContato" />
		<property name="jobDataAsMap">
		  <map>
			<entry key="emailSender" value-ref="runSendEmailContato" />
		  </map>
		</property>
	</bean>
 
	<!-- Simple Trigger, run every 5 seconds -->
	
	<bean id="simpleTrigger" 
                class="org.springframework.scheduling.quartz.SimpleTriggerBean">
		<property name="jobDetail" ref="runMeJob" />
		<property name="repeatInterval" value="5000" />
		<property name="startDelay" value="1000" />
 
	</bean>
	
	<!-- Cron Trigger, run every 5 seconds -->
	<bean id="cronTrigger" 
                class="org.springframework.scheduling.quartz.CronTriggerBean">
		<property name="jobDetail" ref="runMeJob" />
		<property name="cronExpression" value="0 0/1 * * * ?" />
 
	</bean>
 
 	<bean id="cronTriggerSendAnuncio" 
                class="org.springframework.scheduling.quartz.CronTriggerBean">
		<property name="jobDetail" ref="runJobSendAnuncio" />
		<property name="cronExpression" value="0 0/1 * * * ?" />
 
	</bean>
	
	<bean id="cronTriggerSendContato" 
                class="org.springframework.scheduling.quartz.CronTriggerBean">
		<property name="jobDetail" ref="runJobSendContato" />
		<property name="cronExpression" value="0 0/1 * * * ?" />
 
	</bean>
	
	<bean id="cronTriggerSendNoticia" 
                class="org.springframework.scheduling.quartz.CronTriggerBean">
		<property name="jobDetail" ref="runJobSendNoticia" />
		<property name="cronExpression" value="0 10 * * * ?" />
 
	</bean>
 
	<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
		<property name="jobDetails">
			<list>
				<ref bean="runMeJob" />
			</list>
		</property>
		<property name="triggers">
			<list>
				<ref bean="cronTrigger" />
			</list>
		</property>
	</bean>
	
	<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
		<property name="jobDetails">
			<list>
				<ref bean="runJobSendAnuncio" />
			</list>
		</property>
		<property name="triggers">
			<list>
				<ref bean="cronTriggerSendAnuncio" />
			</list>
		</property>
	</bean>
	
	<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
		<property name="jobDetails">
			<list>
				<ref bean="runJobSendContato" />
			</list>
		</property>
		<property name="triggers">
			<list>
				<ref bean="cronTriggerSendContato" />
			</list>
		</property>
	</bean>
	
	<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
		<property name="jobDetails">
			<list>
				<ref bean="runJobSendNoticia" />
			</list>
		</property>
		<property name="triggers">
			<list>
				<ref bean="cronTriggerSendNoticia" />
			</list>
		</property>
	</bean>
 
</beans>